<template>
  <div class="divBox">
    <el-card class="box-card">
      <el-button
        class="submission priamry_border"
        style="display: flex;float: right"
        @click="back()"
        >返回</el-button
      >
      <el-form
        class="formValidate mt20"
        label-width="120px"
        @submit.native.prevent
      >
        <el-row>
          <el-col :span="8">
            <el-form-item label="记录人名称：">
              <span v-html="roomDatalist.authorName || '无'"></span>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="记录类型：">
              <span v-if="roomDatalist.type == 1 || 0">{{ roomDatalist.type ? "系统定时任务" : "异常错误记录" }}</span>
              <span v-if="roomDatalist.type == 2">管理员操作</span>
              <span v-if="roomDatalist.type == 3">商家操作</span>
              <span v-if="roomDatalist.type == 4">用户操作</span>
              <span v-if="roomDatalist.type == 5">游客</span>
            </el-form-item>
          </el-col>
        </el-row>
        <div style="padding: 0px 20px;border-bottom: 1px solid #e6ebf5;"></div>
        <el-row>
          <el-col :span="8">
            <el-form-item label="记录人id:">
              <span v-html="roomDatalist.authorId || '无'"></span>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="更新时间：">
              <span v-html="roomDatalist.updateTime || '无'"></span>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="创建时间：">
              <span v-html="roomDatalist.createTime || '无'"></span>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="记录标题：">
              <span v-html="roomDatalist.title || '无'"></span>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="记录内容：">
              <span v-html="roomDatalist.content || '无'"></span>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="业务id:">
              <span v-html="roomDatalist.ywid || '无'"></span>
            </el-form-item>
          </el-col>
        </el-row>
        <div style="padding: 0px 20px;border-bottom: 1px solid #e6ebf5;"></div>
        <el-row>
          <el-col :span="8">
            <el-form-item label="状态：">
              <el-switch
                disabled
                v-model="roomDatalist.status"
                :active-value="roomDatalist.status === 0"
                :inactive-value="roomDatalist.status === 1"
              >
              </el-switch>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
    </el-card>
  </div>
</template>

<script>
import { getbusinessApi } from "@/api/businessRecord";
export default {
  name: "businessRecordDetail",
  data() {
    return {
      roomDatalist: [],
      value1: true
    };
  },
  mounted() {
    console.log(this.$route.params.id, "this.$route.params.id");
    this.getDetail(this.$route.params.id);
  },
  methods: {
    // 获取业务详情
    getDetail(roomId) {
      getbusinessApi({ id: roomId })
        .then(res => {
          this.roomDatalist = res;
          console.log("res0000:", this.roomDatalist);
        })
        .catch(() => {
          this.roomDatalist = [];
        });
    },
    // 返回
    back() {
      this.$router.go(-1);
    }
  }
};
</script>

<style scoped lang="scss">
.logistics {
  align-items: center;
  padding: 10px 0px;

  .logistics_img {
    width: 45px;
    height: 45px;
    margin-right: 12px;

    img {
      width: 100%;
      height: 100%;
    }
  }

  .logistics_cent {
    span {
      display: block;
      font-size: 12px;
    }
  }
}

.trees-coadd {
  width: 100%;
  height: 400px;
  border-radius: 4px;
  overflow: hidden;

  .scollhide {
    width: 100%;
    height: 100%;
    overflow: auto;
    margin-left: 18px;
    padding: 10px 0 10px 0;
    box-sizing: border-box;

    .content {
      font-size: 12px;
    }

    .time {
      font-size: 12px;
      color: #2d8cf0;
    }
  }
}

.title {
  margin-bottom: 14px;
  color: #303133;
  font-weight: 500;
  font-size: 14px;
}

.description {
  &-term {
    display: table-cell;
    padding-bottom: 5px;
    line-height: 20px;
    width: 50%;
    font-size: 12px;
    color: #606266;
  }

  ::v-deep .el-divider--horizontal {
    margin: 12px 0 !important;
  }
}
</style>
